package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IAgencyCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author wyy
 */
@RestController("agencyCertificationAuditController")
@RequestMapping("/agency/agency-certification-audit")
@Api(tags = "机构端 - 认证审核相关接口")
public class CertificationAuditController {
    @Resource
    private IAgencyCertificationService agencyCertificationService;

    @PostMapping
    @ApiOperation("机构端提交认证申请")
    public void submitAuth(@RequestBody AgencyCertificationAuditAddReqDTO auditAddReqDTO) {
        this.agencyCertificationService.submitAuth(auditAddReqDTO);
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO rejectReason(CertificationAuditReqDTO certificationAuditReqDTO) {
        RejectReasonResDTO rejectReasonResDTO = this.agencyCertificationService.rejectReason(certificationAuditReqDTO);
        return rejectReasonResDTO;
    }
}
